package com.zy.design.demo.structural;

/**
 * 外观模式
 * 特点：提供简化的接口，隐藏系统复杂性。
 */
class SubsystemA {
    public void operationA() { System.out.println("子系统A操作"); }
}

class SubsystemB {
    public void operationB() { System.out.println("子系统B操作"); }
}

class Facade {
    private SubsystemA a = new SubsystemA();
    private SubsystemB b = new SubsystemB();

    public void performOperation() {
        System.out.println("外观模式操作：");
        a.operationA();
        b.operationB();
    }
}

class Main4 {
    public static void main(String[] args) {
        Facade facade = new Facade();
        facade.performOperation();
    }
}
